package com.gardenguell.salad.ui.activity;

import android.os.Bundle;
import com.gardenguell.salad.R;
import com.gardenguell.salad.data.model.History;
import com.gardenguell.salad.ui.activity.base.BaseActivity;

public class ImagePreviewActivity extends BaseActivity{

	private String imageUrl;
	
	private History history;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_image_preview);
		// loadImage();
	}

	/**
	private void loadImage() {
		imageUrl = getIntent().getStringExtra(KEY_IMAGE);
		location = (Location) getIntent().getParcelableExtra(KEY_LOCATION);
		
		if(TextUtils.isEmpty(imageUrl)){
			ToastUtils.show("图片失效了！！");
			return;
		}
		
		ImageLoaderHelper.getInstance().show(ivImage, imageUrl);
		
		
		ivImage.postDelayed(new Runnable() {
			
			@Override
			public void run() {
				PhotoViewAttacher attacher = new PhotoViewAttacher(ivImage);
			}
		}, 600);
		
		
		if(location==null){
			tvLocation.setVisibility(View.GONE);
		}else{
			tvLocation.setVisibility(View.VISIBLE);
			tvLocation.setText(DateUtils.formatStr(location.getLocDate())+"\n"+location.getAddress());
		}
	}

	@Override
	protected void initActionBar() {
		setTitle("预览");
		
	}

	@Override
	protected void initListener() {
		
		
	}
	
	public static void start(Context context,String imageUrl){
		Intent intent = new Intent(context, ImagePreviewActivity.class);
		intent.putExtra(KEY_IMAGE, imageUrl);
		context.startActivity(intent);
	}
	
	public static void start(Context context,String imageUrl,Location location){
		Intent intent = new Intent(context, ImagePreviewActivity.class);
		intent.putExtra(KEY_IMAGE, imageUrl);
		intent.putExtra(KEY_LOCATION, location);
		context.startActivity(intent);
	}


	**/
}
